home *** CD-ROM | disk | FTP | other *** search
-
-
-
- UUUUSSSSIIIINNNNIIIITTTTSSSSEEEEMMMMAAAA((((3333PPPP)))) UUUUSSSSIIIINNNNIIIITTTTSSSSEEEEMMMMAAAA((((3333PPPP))))
-
-
-
- NNNNAAAAMMMMEEEE
- usinitsema - initialize a semaphore
-
- CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<uuuulllloooocccckkkkssss....hhhh>>>>
-
- iiiinnnntttt uuuussssiiiinnnniiiittttsssseeeemmmmaaaa ((((uuuusssseeeemmmmaaaa____tttt ****sssseeeemmmmaaaa,,,, iiiinnnntttt vvvvaaaallll))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _u_s_i_n_i_t_s_e_m_a initializes the semaphore specified by _s_e_m_a. The count of the
- semaphore is set to the value specified by _v_a_l. A value of 0 implies no
- available resources, and the first process that attempts a 'P' operation
- (via _u_s_p_s_e_m_a) will block. This can be viewed as a synchronizing
- semaphore, since the goal is to always have a process block until another
- has completed an operation that the first process requires. Positive
- values for _v_a_l can be used for tracking a collection of resources. The
- simplest case of a value of 1 implements the common mutual exclusion
- semaphore, namely one and only one process will be permitted through a
- semaphore at a time. Values greater than one imply that up to _v_a_l
- resources may be simultaneously used, but requests for more than _v_a_l
- resources cause the calling process to block until a resource comes free
- (by a process holding a resource performing a _u_s_v_s_e_m_a).
-
- Metering and debugging are reinitialized and the history logging
- mechanism is set according to the global setting (see _u_s_c_o_n_f_i_g(3P)).
- _u_s_i_n_i_t_s_e_m_a should only be used for semaphores previously allocated using
- either _u_s_n_e_w_s_e_m_a(3P) or _u_s_n_e_w_p_o_l_l_s_e_m_a(3P). Note that _u_s_i_n_i_t_s_e_m_a does not
- check whether any process is currently waiting for the semaphore. Any
- such information is lost. This means that any processes that are waiting
- for the semaphore (either blocked or queued on a pollable semaphore) will
- not be woken, nor will the internal counts kept in the operating system
- be reset.
-
- _u_s_i_n_i_t_s_e_m_a will fail if the following is true:
-
- [EINVAL] _v_a_l must be greater than or equal to 0 and less than
- 30000;
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- uscpsema(3P), usctlsema(3P), usfreesema(3P), usinit(3P), usnewsema(3P),
- usnewpollsema(3P), uspsema(3P), usvsema(3P).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Upon successful completion, a value of 0 is returned. Otherwise, a value
- of -1 is returned and _e_r_r_n_o is set to indicate the error.
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-